package com.atguigu.tingshu.account.service;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.account.UserAccount;
import com.atguigu.tingshu.vo.account.AccountLockResultVo;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {
    /**
     * 初始化用户账户
     * @param userId
     */
    void initUserAccount(String userId);

    /**
     * 根据用户Id 来获取账户余额
     * @param userId
     * @return
     */
    BigDecimal getAvailableAmount(Long userId);


    /**
     * 检查与锁定账户金额
     * @param accountLockVo
     * @return
     */
    Result<AccountLockResultVo> checkAndLock(AccountLockVo accountLockVo);

    void minus(String orderNo);

    void unlock(String orderNo);
}
